﻿using System;
using System.Windows;

using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Logging;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using Infrastructure;

namespace rssmain
{
    public class MainModule : IModule
    {
        IRegionManager _regionManager;
        IUnityContainer _container;
        ILoggerFacade logger;

        public MainModule(IUnityContainer container, IRegionManager regionManager, ILoggerFacade logger)
        {
            _container = container;
            _regionManager = regionManager;
            this.logger = logger;
        }

        public void Initialize()
        {
            logger.Log("初始化Main模块", Category.Debug, Priority.Low);
            _regionManager.RegisterViewWithRegion(RegionNames.NavRegion, typeof(MainModule));
            _container.RegisterType<object, MainPage>(ViewNames.MainPage);
        }
    }
}
